setTimeout(() => {
  console.log(1);
  Promise.resolve().then(() => {
    console.log('promise1');
  });
});

setTimeout(() => {
  console.log(2);
  Promise.resolve().then(() => {
    console.log('promise2');
  });
});

//早期node↓ 是在清空当前阶段的所有暂存的宏任务才会清空微任务
//1 2 promise1  promise2

//后来改成和浏览器端一样了,每执行完一个宏任务就会清空微任务队列
//1 promise1 2 promise2
